const got = require("got")
var token = require("./token.js");
const config = require("./config.js");
const { json } = require("express");

class File {
	constructor() {
		this.env = config.env;
		this.token = token
	}

	/**
	 * 获取上传地址
	 * 
	 * 
	*/

	async uploadFile() {
		var token = await this.token
        let path="testfile.png"
		var context = {
			"env": this.env,
			"path": path
		}
		var url = "https://api.weixin.qq.com/tcb/uploadfile?access_token=" + token;
		let result = await got.post(url, { json: context })
		return JSON.parse(result.body)
	}





}

module.exports = new File()
